
/*
'===============================================================================
'  MP.LayerHelper.MP_OBS.BL.MbModuleDepartManager
'===============================================================================
*/

using System;
using System.Configuration;
using System.Data;
using System.Data.SqlClient;
using MP.LayerHelper.MP_OBS.BLL;
using MP.LayerHelper.MP_OBS.DAL;
using MP.LayerHelper.MP_OBS.DAL.EntityClasses;
using MP.LayerHelper.MP_OBS.DAL.FactoryClasses;
using MP.LayerHelper.MP_OBS.DAL.HelperClasses;
using SD.LLBLGen.Pro.ORMSupportClasses;
using MP.Core.Library;

namespace MP.LayerHelper.MP_OBS.BLL
{
	public class MbModuleDepartManager : MbModuleDepartManagerBase
	{
		/// <summary>
		/// Purpose: Class constructor.
		/// </summary>
		public MbModuleDepartManager()
		{
			// Nothing for now.
		}
		
		/// <summary>
		/// Method to create an instance of MbModuleDepartManager
		/// </summary>
		/// <returns>An instant of MbModuleDepartManager class</returns>
		public static MbModuleDepartManager CreateInstant()
		{
			return new MbModuleDepartManager();
		}

        public DataSet GetModuleDepart(Guid DepartID)
        {
            string strSQL = "PRC_ModuleDepart";
            SqlParameter param = new SqlParameter("@DepartId", DepartID);
            return SqlHelper.ExecuteDataSet(SqlHelper.ConnectionStringOBS, CommandType.StoredProcedure, strSQL, param);
        }

        public void UpdateModuleDepart(Guid DepartId, string ModCode, bool IsRole)
        {
            string strSQL = "PRC_UpdateModuleDepart";
            SqlParameter[] param = new SqlParameter[3];
            param[0] = new SqlParameter("@DepartId", DepartId);
            param[1] = new SqlParameter("@ModCode", ModCode);
            param[2] = new SqlParameter("@IsRole", IsRole);
            SqlHelper.ExecuteNonQuery(SqlHelper.ConnectionStringOBS, CommandType.StoredProcedure, strSQL, param);
        }
	}
}
